<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户信息管理</title>
    <!-- 引入 bootstrap的 css -->
    <link type="text/css" rel="stylesheet" th:href="@{plugins/bootstrap-3.4.1-dist/css/bootstrap.min.css}"/>
    <!-- 引入分页插件pagination的css样式文件 -->
    <link type="text/css" rel="stylesheet" th:href="@{plugins/pagination-2.1.5/css/pagination.css}">
    <!-- 引入 jquery 框架，需要第一个引入，因为其他的js会使用该框架 -->
    <script type="text/javascript" th:src="@{plugins/jquery-3.6.0/jquery-3.6.0.min.js}"></script>
    <!-- 引入 bootstrap的js -->
    <script type="text/javascript" th:src="@{plugins/bootstrap-3.4.1-dist/js/bootstrap.min.js}"></script>
    <!-- 引入假分页控件pagination的js -->
    <script type="text/javascript" th:src="@{plugins/pagination-2.1.5/js/pagination.min.js}"></script>
    <!-- 引入自己写的js -->
    <script type="text/javascript" th:src="@{js/backstage/goodsInfoManager.js}"></script>
</head>
<body>
</br>

<form id="insertForm" action="addGoodInfo" method="post" class="form-horizontal"
      enctype="multipart/form-data">
    <input type="hidden" id="gid" name="gid">
    <div class="form-group">
        <label class="col-sm-2 control-label">商品</label>
        <div class="col-sm-3">
            <input type="text" id="gname_edit" name="gname" class="form-control">
            <span class="help-block m-b-none" id="gname-label" style="color: #ff0000"></span>
        </div>
        <label class="col-sm-2 control-label">生产地</label>
        <div class="col-sm-3">
            <input type="text" id="producer_edit" name="producer" class="form-control">
            <span class="help-block m-b-none" id="producer-label" style="color: #ff0000"></span>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    <div class="form-group">
        <label class="col-sm-2 control-label">价格</label>
        <div class="col-sm-3">
            <input type="text" id="price_edit" name="price" class="form-control">
            <span class="help-block m-b-none" id="price-label" style="color: #ff0000"></span>
        </div>
        <label class="col-sm-2 control-label">单位</label>
        <div class="col-sm-3">
            <input type="text" id="unit_edit" name="unit" class="form-control">
            <span class="help-block m-b-none" id="unit-label" style="color: #ff0000"></span>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    <div class="form-group">
        <label class="col-sm-2 control-label">库存</label>
        <div class="col-sm-3">
            <input type="text" id="inventory_edit" name="inventory" class="form-control">
            <span class="help-block m-b-none" id="inventory-label" style="color: #ff0000"></span>
        </div>
        <label class="col-sm-2 control-label">图片</label>
        <div class="col-sm-3">
            <!-- 因为文件要使用 MultipartFile 进行映射，所以不要和实体类的属性名，保持一致 -->
            <input type="file" id="image_edit" name="file_image" class="form-control">
            <span class="help-block m-b-none" id="image-label" style="color: #ff0000"></span>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    <div class="form-group">
        <label class="col-sm-2 control-label">规格</label>
        <div class="col-sm-3">
            <input type="text" id="specification_edit" name="specification" class="form-control">
            <span class="help-block m-b-none" id="specification-label" style="color: #ff0000"></span>
        </div>
        <label class="col-sm-2 control-label">标签</label>
        <div class="col-sm-3">
            <input type="text" id="lable_edit" name="lable" class="form-control">
            <span class="help-block m-b-none" id="label-label" style="color: #ff0000"></span>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    <div class="form-group">
        <label class="col-sm-2 control-label">折扣</label>
        <div class="col-sm-3">
            <input type="text" id="discount_edit" name="discount" class="form-control">
            <span class="help-block m-b-none" id="discount-label" style="color: #ff0000"></span>
        </div>
    </div>
</form>
<div align="center">
    <button type="reset" class="btn btn-default" onclick="reset()">清空</button>
    <button type="submit" class="btn btn-primary" onclick="insertGood()">保存</button>
</div>
</body>
</html>